/*
 * @作者: kerwin
 * @公众号: 大前端私房菜
 */
import React,{useEffect} from 'react'
import {useParams} from 'react-router-dom'
import store from '../redux/store'
// import { show,hide } from '../redux/actionCreator/TabbarActionCreator'
// import store from '../redux/store'

export default function Detail(props) {
    // console.log(props.match.params.myid,"利用id去后端拿数据。")
    // console.log(props.location.query.myid,"利用id去后端拿数据。")
    // console.log(props.location.state.myid,"利用id去后端拿数据。")
    let params=useParams()
    let id=params.id
    useEffect(() => {
        console.log("create")
        // 发布发送数据跳转tabbar
        store.dispatch({
            type:"hide-tabbar"
        })
        return()=>{
            console.log("destory")
            store.dispatch({
                type:"show-tabbar"
            })
        }
        
    }, [])

    return (
        <div>
            deteail--{id}
        </div>
    )
}
